package com.jiazhong.重载;

public class Demo02 {
    public static void main(String[] args) {
        Ms ms=new Ms();
        int max1= ms.max(3,4);
        double max2=ms.max(3.0,4.0);
        double max3=ms.max(3.0,4.0,5.0);
        System.out.println(max1);
        System.out.println(max2);
        System.out.println(max3);
    }
}

class Ms {
    public int max(int a,int b){
        int max=a>b?a:b;
        return max;
    }
    public double max(double a,double b){
        double max=a>b?a:b;
        return max;
    }
    public double max(double a,double b,double c){
        double max=(a>b?a:b)>c?(a>b?a:b):c;
        return max;
    }
}
